package net.ljh.bean;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.Email;
import java.util.List;
import java.util.Map;

/**
 * created with IntelliJ IDEA
 * Decription:
 * User:梁家豪
 * Date:2018-11-28
 * Time:12:04
 */
@Component
@ConfigurationProperties(prefix = "user")
@Validated
public class User {


    private String name;

    @Value("#{2*9}")
    private Integer age;
    private Map<String,Object> behavior;
    @Email
    private String email;
    private List<String> hobby;
    private People people;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Map<String, Object> getBehavior() {
        return behavior;
    }

    public void setBehavior(Map<String, Object> behavior) {
        this.behavior = behavior;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public List<String> getHobby() {
        return hobby;
    }

    public void setHobby(List<String> hobby) {
        this.hobby = hobby;
    }

    public People getPeople() {
        return people;
    }

    public void setPeople(People people) {
        this.people = people;
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", behavior=" + behavior +
                ", email='" + email + '\'' +
                ", hobby=" + hobby +
                ", people=" + people +
                '}';
    }
}
